import { service } from '@/utils/request'

export function register(mobile, password, verification_code, invite_code) {
  return service({
    url: '/index/register',
    method: 'post',
    data: {
      mobile,
      password,
      verification_code,
      invite_code
    }
  })
}

export function login(mobile, password, verification_code, type, empno) {
  return service({
    url: '/index/login',
    method: 'post',
    data: {
      mobile,
      password,
      verification_code,
      type,
      empno
    }
  })
}
// 获取验证码
export function getCode(data) {
  return service({
    url: '/index/send_code',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return service({
    url: '/user/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return service({
    url: '/user/logout',
    method: 'post'
  })
}

